﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract ArtiklVrijednosti typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ArtiklVrijednostiDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ArtiklVrijednostiDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ArtiklVrijednosti _currentArtiklVrijednosti = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxArtiklVrijednostiDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxArtiklVrijednostiErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxArtiklVrijednostiBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Tekstualno property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxTekstualnoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the CijeliBroj property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxCijeliBrojDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the RealanBroj property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxRealanBrojDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Datum property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Slika property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxSlikaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDArtiklSpecifikacija property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDArtiklSpecifikacijaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDArtikl property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDArtiklDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.Artikl> _IDArtiklList;
		
		/// <summary> 
		/// The list of selectable Artikl
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Artikl> IDArtiklList
		{
			get {return this._IDArtiklList;}
			set 
			{
				this._IDArtiklList = value;
				this.uxIDArtiklDataGridViewColumn.DataSource = null;
				this.uxIDArtiklDataGridViewColumn.DataSource = this._IDArtiklList;
			}
		}
		
		private bool _allowNewItemInIDArtiklList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Artikl
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDArtiklList
		{
			get { return _allowNewItemInIDArtiklList;}
			set
			{
				this._allowNewItemInIDArtiklList = value;
				this.uxIDArtiklDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.ArtiklSpecifikacija> _IDArtiklSpecifikacijaList;
		
		/// <summary> 
		/// The list of selectable ArtiklSpecifikacija
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ArtiklSpecifikacija> IDArtiklSpecifikacijaList
		{
			get {return this._IDArtiklSpecifikacijaList;}
			set 
			{
				this._IDArtiklSpecifikacijaList = value;
				this.uxIDArtiklSpecifikacijaDataGridViewColumn.DataSource = null;
				this.uxIDArtiklSpecifikacijaDataGridViewColumn.DataSource = this._IDArtiklSpecifikacijaList;
			}
		}
		
		private bool _allowNewItemInIDArtiklSpecifikacijaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ArtiklSpecifikacija
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDArtiklSpecifikacijaList
		{
			get { return _allowNewItemInIDArtiklSpecifikacijaList;}
			set
			{
				this._allowNewItemInIDArtiklSpecifikacijaList = value;
				this.uxIDArtiklSpecifikacijaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ArtiklVrijednosti> _ArtiklVrijednostiList;
				
		/// <summary> 
		/// The list of ArtiklVrijednosti to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ArtiklVrijednosti> ArtiklVrijednostiList
		{
			get {return this._ArtiklVrijednostiList;}
			set
			{
				this._ArtiklVrijednostiList = value;
				this.uxArtiklVrijednostiBindingSource.DataSource = null;
				this.uxArtiklVrijednostiBindingSource.DataSource = value;
				this.uxArtiklVrijednostiDataGridView.DataSource = null;
				this.uxArtiklVrijednostiDataGridView.DataSource = this.uxArtiklVrijednostiBindingSource;				
				//this.uxArtiklVrijednostiBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxArtiklVrijednostiBindingSource_ListChanged);
				this.uxArtiklVrijednostiBindingSource.CurrentItemChanged += new System.EventHandler(OnArtiklVrijednostiBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnArtiklVrijednostiBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentArtiklVrijednosti = uxArtiklVrijednostiBindingSource.Current as Entities.ArtiklVrijednosti;
			
			if (_currentArtiklVrijednosti != null)
			{
				_currentArtiklVrijednosti.Validate();
			}
			//_ArtiklVrijednosti.Validate();
			OnCurrentEntityChanged();
		}

		//void uxArtiklVrijednostiBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.ArtiklVrijednosti"/> instance.
		/// </summary>
		public Entities.ArtiklVrijednosti SelectedArtiklVrijednosti
		{
			get {return this._currentArtiklVrijednosti;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxArtiklVrijednostiDataGridView.VirtualMode;}
			set
			{
				this.uxArtiklVrijednostiDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxArtiklVrijednostiDataGridView.AllowUserToAddRows;}
			set {this.uxArtiklVrijednostiDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxArtiklVrijednostiDataGridView.AllowUserToDeleteRows;}
			set {this.uxArtiklVrijednostiDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxArtiklVrijednostiDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxArtiklVrijednostiDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ArtiklVrijednostiDataGridViewBase"/> class.
		/// </summary>
		public ArtiklVrijednostiDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxArtiklVrijednostiDataGridView = new System.Windows.Forms.DataGridView();
			this.uxArtiklVrijednostiBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxArtiklVrijednostiErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxTekstualnoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxCijeliBrojDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxRealanBrojDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxSlikaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDArtiklSpecifikacijaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDArtiklDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			//this.uxIDArtiklBindingSource = new ArtiklBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDArtiklBindingSource)).BeginInit();
			//this.uxIDArtiklSpecifikacijaBindingSource = new ArtiklSpecifikacijaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDArtiklSpecifikacijaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxArtiklVrijednostiDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxArtiklVrijednostiBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxArtiklVrijednostiErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxArtiklVrijednostiErrorProvider
			// 
			this.uxArtiklVrijednostiErrorProvider.ContainerControl = this;
			this.uxArtiklVrijednostiErrorProvider.DataSource = this.uxArtiklVrijednostiBindingSource;						
			// 
			// uxArtiklVrijednostiDataGridView
			// 
			this.uxArtiklVrijednostiDataGridView.AutoGenerateColumns = false;
			this.uxArtiklVrijednostiDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxArtiklVrijednostiDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxTekstualnoDataGridViewColumn,
		this.uxCijeliBrojDataGridViewColumn,
		this.uxRealanBrojDataGridViewColumn,
		this.uxDatumDataGridViewColumn,
		this.uxSlikaDataGridViewColumn,
		this.uxIDArtiklSpecifikacijaDataGridViewColumn,
		this.uxIDArtiklDataGridViewColumn			});
			this.uxArtiklVrijednostiDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxArtiklVrijednostiDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxArtiklVrijednostiDataGridView.Name = "uxArtiklVrijednostiDataGridView";
			this.uxArtiklVrijednostiDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxArtiklVrijednostiDataGridView.TabIndex = 0;	
			this.uxArtiklVrijednostiDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxArtiklVrijednostiDataGridView.EnableHeadersVisualStyles = false;
			this.uxArtiklVrijednostiDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnArtiklVrijednostiDataGridViewDataError);
			this.uxArtiklVrijednostiDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnArtiklVrijednostiDataGridViewCellValueNeeded);
			this.uxArtiklVrijednostiDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnArtiklVrijednostiDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxTekstualnoDataGridViewColumn
			//
			this.uxTekstualnoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxTekstualnoDataGridViewColumn.DataPropertyName = "Tekstualno";
			this.uxTekstualnoDataGridViewColumn.HeaderText = "Tekstualno";
			this.uxTekstualnoDataGridViewColumn.Name = "uxTekstualnoDataGridViewColumn";
			this.uxTekstualnoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxTekstualnoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxTekstualnoDataGridViewColumn.ReadOnly = false;		
			//
			// uxCijeliBrojDataGridViewColumn
			//
			this.uxCijeliBrojDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxCijeliBrojDataGridViewColumn.DataPropertyName = "CijeliBroj";
			this.uxCijeliBrojDataGridViewColumn.HeaderText = "CijeliBroj";
			this.uxCijeliBrojDataGridViewColumn.Name = "uxCijeliBrojDataGridViewColumn";
			this.uxCijeliBrojDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxCijeliBrojDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxCijeliBrojDataGridViewColumn.ReadOnly = false;		
			//
			// uxRealanBrojDataGridViewColumn
			//
			this.uxRealanBrojDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxRealanBrojDataGridViewColumn.DataPropertyName = "RealanBroj";
			this.uxRealanBrojDataGridViewColumn.HeaderText = "RealanBroj";
			this.uxRealanBrojDataGridViewColumn.Name = "uxRealanBrojDataGridViewColumn";
			this.uxRealanBrojDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxRealanBrojDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxRealanBrojDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDataGridViewColumn
			//
			this.uxDatumDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDataGridViewColumn.DataPropertyName = "Datum";
			this.uxDatumDataGridViewColumn.HeaderText = "Datum";
			this.uxDatumDataGridViewColumn.Name = "uxDatumDataGridViewColumn";
			this.uxDatumDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDataGridViewColumn.ReadOnly = false;		
			//
			// uxSlikaDataGridViewColumn
			//
			this.uxSlikaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSlikaDataGridViewColumn.DataPropertyName = "Slika";
			this.uxSlikaDataGridViewColumn.HeaderText = "Slika";
			this.uxSlikaDataGridViewColumn.Name = "uxSlikaDataGridViewColumn";
			this.uxSlikaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSlikaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSlikaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDArtiklSpecifikacijaDataGridViewColumn
			//
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.DataPropertyName = "IDArtiklSpecifikacija";
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.HeaderText = "IDArtiklSpecifikacija";
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.Name = "uxIDArtiklSpecifikacijaDataGridViewColumn";
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDArtiklDataGridViewColumn
			//
			this.uxIDArtiklDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDArtiklDataGridViewColumn.DataPropertyName = "IDArtikl";
			this.uxIDArtiklDataGridViewColumn.HeaderText = "IDArtikl";
			this.uxIDArtiklDataGridViewColumn.Name = "uxIDArtiklDataGridViewColumn";
			this.uxIDArtiklDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDArtiklDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDArtiklDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDArtiklDataGridViewColumn
			//				
			this.uxIDArtiklDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDArtiklDataGridViewColumn.ValueMember = "ID";	
			this.uxIDArtiklDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDArtiklDataGridViewColumn.DataSource = uxIDArtiklBindingSource;				
				
			//
			// uxIDArtiklSpecifikacijaDataGridViewColumn
			//				
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDArtiklSpecifikacijaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDArtiklSpecifikacijaDataGridViewColumn.DataSource = uxIDArtiklSpecifikacijaBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxArtiklVrijednostiDataGridView);
			this.Name = "ArtiklVrijednostiDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDArtiklBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDArtiklSpecifikacijaBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxArtiklVrijednostiErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxArtiklVrijednostiDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxArtiklVrijednostiBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ArtiklVrijednostiDataGridViewEventArgs args = new ArtiklVrijednostiDataGridViewEventArgs();
				args.ArtiklVrijednosti = _currentArtiklVrijednosti;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ArtiklVrijednostiDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ArtiklVrijednosti	_ArtiklVrijednosti;
	
			/// <summary>
			/// the  Entities.ArtiklVrijednosti instance.
			/// </summary>
			public Entities.ArtiklVrijednosti ArtiklVrijednosti
			{
				get { return _ArtiklVrijednosti; }
				set { _ArtiklVrijednosti = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxArtiklVrijednostiDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnArtiklVrijednostiDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxArtiklVrijednostiDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnArtiklVrijednostiDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxArtiklVrijednostiDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = ArtiklVrijednostiList[e.RowIndex].ID;
						break;
					case "uxTekstualnoDataGridViewColumn":
						e.Value = ArtiklVrijednostiList[e.RowIndex].Tekstualno;
						break;
					case "uxCijeliBrojDataGridViewColumn":
						e.Value = ArtiklVrijednostiList[e.RowIndex].CijeliBroj;
						break;
					case "uxRealanBrojDataGridViewColumn":
						e.Value = ArtiklVrijednostiList[e.RowIndex].RealanBroj;
						break;
					case "uxDatumDataGridViewColumn":
						e.Value = ArtiklVrijednostiList[e.RowIndex].Datum;
						break;
					case "uxSlikaDataGridViewColumn":
						e.Value = ArtiklVrijednostiList[e.RowIndex].Slika;
						break;
					case "uxIDArtiklSpecifikacijaDataGridViewColumn":
						e.Value = ArtiklVrijednostiList[e.RowIndex].IDArtiklSpecifikacija;
						break;
					case "uxIDArtiklDataGridViewColumn":
						e.Value = ArtiklVrijednostiList[e.RowIndex].IDArtikl;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxArtiklVrijednostiDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnArtiklVrijednostiDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxArtiklVrijednostiDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						ArtiklVrijednostiList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxTekstualnoDataGridViewColumn":
						ArtiklVrijednostiList[e.RowIndex].Tekstualno = (System.String)e.Value;
						break;
					case "uxCijeliBrojDataGridViewColumn":
						ArtiklVrijednostiList[e.RowIndex].CijeliBroj = (System.Int32?)e.Value;
						break;
					case "uxRealanBrojDataGridViewColumn":
						ArtiklVrijednostiList[e.RowIndex].RealanBroj = (System.Single?)e.Value;
						break;
					case "uxDatumDataGridViewColumn":
						ArtiklVrijednostiList[e.RowIndex].Datum = (System.DateTime?)e.Value;
						break;
					case "uxSlikaDataGridViewColumn":
						ArtiklVrijednostiList[e.RowIndex].Slika = (System.Byte[])e.Value;
						break;
					case "uxIDArtiklSpecifikacijaDataGridViewColumn":
						ArtiklVrijednostiList[e.RowIndex].IDArtiklSpecifikacija = (System.Int32)e.Value;
						break;
					case "uxIDArtiklDataGridViewColumn":
						ArtiklVrijednostiList[e.RowIndex].IDArtikl = (System.Int32)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
